.class public Lcom/teewoo/app/bus/ui/WebViewActivity;
.super Lcom/teewoo/app/bus/inface/BaseActivity;
.source "WebViewActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/teewoo/app/bus/ui/WebViewActivity$MyWebChromeClient;,
        Lcom/teewoo/app/bus/ui/WebViewActivity$myWebViewClient;
    }
.end annotation


# instance fields
.field private backButton:Landroid/view/View;

.field private backView:Landroid/widget/ImageView;

.field private collectionButton:Landroid/view/View;

.field private collectionManager:Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;

.field private collectionView:Landroid/widget/ImageView;

.field private currentUrl:Ljava/lang/String;

.field private homeButton:Landroid/view/View;

.field private homeView:Landroid/widget/ImageView;

.field private html:Ljava/lang/String;

.field private isCollected:Z

.field private localWebView:Landroid/webkit/WebView;

.field private progressDlg:Landroid/app/ProgressDialog;

.field private refreshButton:Landroid/view/View;

.field private refreshView:Landroid/widget/ImageView;

.field private title:Ljava/lang/String;

.field private yesListener:Landroid/content/DialogInterface$OnClickListener;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 27
    invoke-direct {p0}, Lcom/teewoo/app/bus/inface/BaseActivity;-><init>()V

    .line 29
    const-string v0, ""

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    .line 31
    const-string v0, ""

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->html:Ljava/lang/String;

    .line 32
    const-string v0, ""

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->title:Ljava/lang/String;

    .line 33
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->isCollected:Z

    .line 182
    new-instance v0, Lcom/teewoo/app/bus/ui/WebViewActivity$1;

    invoke-direct {v0, p0}, Lcom/teewoo/app/bus/ui/WebViewActivity$1;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;)V

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->yesListener:Landroid/content/DialogInterface$OnClickListener;

    .line 27
    return-void
.end method

.method static synthetic access$0(Lcom/teewoo/app/bus/ui/WebViewActivity;Landroid/app/ProgressDialog;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 28
    iput-object p1, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->progressDlg:Landroid/app/ProgressDialog;

    return-void
.end method

.method static synthetic access$1(Lcom/teewoo/app/bus/ui/WebViewActivity;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 29
    iput-object p1, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    return-void
.end method

.method static synthetic access$10(Lcom/teewoo/app/bus/ui/WebViewActivity;)Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;
    .locals 1
    .parameter

    .prologue
    .line 44
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionManager:Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;

    return-object v0
.end method

.method static synthetic access$11(Lcom/teewoo/app/bus/ui/WebViewActivity;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 31
    iput-object p1, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->html:Ljava/lang/String;

    return-void
.end method

.method static synthetic access$12(Lcom/teewoo/app/bus/ui/WebViewActivity;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 31
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->html:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$13(Lcom/teewoo/app/bus/ui/WebViewActivity;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 32
    iput-object p1, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->title:Ljava/lang/String;

    return-void
.end method

.method static synthetic access$14(Lcom/teewoo/app/bus/ui/WebViewActivity;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 32
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->title:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$15(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/content/DialogInterface$OnClickListener;
    .locals 1
    .parameter

    .prologue
    .line 182
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->yesListener:Landroid/content/DialogInterface$OnClickListener;

    return-object v0
.end method

.method static synthetic access$2(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/app/ProgressDialog;
    .locals 1
    .parameter

    .prologue
    .line 28
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->progressDlg:Landroid/app/ProgressDialog;

    return-object v0
.end method

.method static synthetic access$3(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/widget/ImageView;
    .locals 1
    .parameter

    .prologue
    .line 40
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->backView:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$4(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/widget/ImageView;
    .locals 1
    .parameter

    .prologue
    .line 42
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->refreshView:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$5(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/widget/ImageView;
    .locals 1
    .parameter

    .prologue
    .line 43
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->homeView:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$6(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/webkit/WebView;
    .locals 1
    .parameter

    .prologue
    .line 30
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    return-object v0
.end method

.method static synthetic access$7(Lcom/teewoo/app/bus/ui/WebViewActivity;)Z
    .locals 1
    .parameter

    .prologue
    .line 33
    iget-boolean v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->isCollected:Z

    return v0
.end method

.method static synthetic access$8(Lcom/teewoo/app/bus/ui/WebViewActivity;)Landroid/widget/ImageView;
    .locals 1
    .parameter

    .prologue
    .line 41
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionView:Landroid/widget/ImageView;

    return-object v0
.end method

.method static synthetic access$9(Lcom/teewoo/app/bus/ui/WebViewActivity;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 29
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    return-object v0
.end method

.method private hasCollected(Ljava/lang/String;)Z
    .locals 2
    .parameter "url"

    .prologue
    .line 263
    iget-object v1, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionManager:Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;

    invoke-virtual {v1, p1}, Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;->find(Ljava/lang/String;)Lcom/teewoo/app/bus/model/collection/URLCollection;

    move-result-object v0

    .line 264
    .local v0, urlCol:Lcom/teewoo/app/bus/model/collection/URLCollection;
    if-nez v0, :cond_0

    const/4 v1, 0x0

    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x1

    goto :goto_0
.end method


# virtual methods
.method public initImageButton()V
    .locals 2

    .prologue
    .line 106
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->backButton:Landroid/view/View;

    new-instance v1, Lcom/teewoo/app/bus/ui/WebViewActivity$2;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/WebViewActivity$2;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 117
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->refreshButton:Landroid/view/View;

    new-instance v1, Lcom/teewoo/app/bus/ui/WebViewActivity$3;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/WebViewActivity$3;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 128
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionButton:Landroid/view/View;

    new-instance v1, Lcom/teewoo/app/bus/ui/WebViewActivity$4;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/WebViewActivity$4;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 171
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->homeButton:Landroid/view/View;

    new-instance v1, Lcom/teewoo/app/bus/ui/WebViewActivity$5;

    invoke-direct {v1, p0}, Lcom/teewoo/app/bus/ui/WebViewActivity$5;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 180
    return-void
.end method

.method public initialUI()V
    .locals 1

    .prologue
    .line 47
    iput-object p0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->context:Landroid/content/Context;

    .line 48
    const v0, 0x7f0a00c2

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/webkit/WebView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    .line 50
    const v0, 0x7f0a00c3

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->backButton:Landroid/view/View;

    .line 51
    const v0, 0x7f0a00c5

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->refreshButton:Landroid/view/View;

    .line 52
    const v0, 0x7f0a00c7

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionButton:Landroid/view/View;

    .line 53
    const v0, 0x7f0a00c9

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->homeButton:Landroid/view/View;

    .line 55
    const v0, 0x7f0a00c4

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->backView:Landroid/widget/ImageView;

    .line 56
    const v0, 0x7f0a00c8

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionView:Landroid/widget/ImageView;

    .line 57
    const v0, 0x7f0a00c6

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->refreshView:Landroid/widget/ImageView;

    .line 58
    const v0, 0x7f0a00ca

    invoke-virtual {p0, v0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->homeView:Landroid/widget/ImageView;

    .line 60
    new-instance v0, Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;

    invoke-direct {v0, p0}, Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionManager:Lcom/teewoo/app/bus/manager/collection/URLCollectionManager;

    .line 61
    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 6
    .parameter "savedInstanceState"

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x1

    .line 65
    invoke-super {p0, p1}, Lcom/teewoo/app/bus/inface/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 66
    const v2, 0x7f030033

    invoke-virtual {p0, v2}, Lcom/teewoo/app/bus/ui/WebViewActivity;->setContentView(I)V

    .line 67
    invoke-virtual {p0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->initialUI()V

    .line 69
    const v2, 0x7f080011

    invoke-virtual {p0, v2}, Lcom/teewoo/app/bus/ui/WebViewActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {p0, v5, v2, v4, v4}, Landroid/app/ProgressDialog;->show(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZZ)Landroid/app/ProgressDialog;

    move-result-object v2

    iput-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->progressDlg:Landroid/app/ProgressDialog;

    .line 71
    invoke-virtual {p0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 73
    .local v0, extras:Landroid/os/Bundle;
    const-string v2, "com.teewoo.app.bus.url"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    .line 74
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    invoke-direct {p0, v2}, Lcom/teewoo/app/bus/ui/WebViewActivity;->hasCollected(Ljava/lang/String;)Z

    move-result v2

    iput-boolean v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->isCollected:Z

    .line 75
    iget-boolean v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->isCollected:Z

    if-eqz v2, :cond_0

    .line 76
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->collectionView:Landroid/widget/ImageView;

    const v3, 0x7f020013

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setBackgroundResource(I)V

    .line 78
    :cond_0
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    invoke-virtual {v2}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v1

    .line 79
    .local v1, localWebSettings:Landroid/webkit/WebSettings;
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setSavePassword(Z)V

    .line 80
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setSaveFormData(Z)V

    .line 81
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setJavaScriptEnabled(Z)V

    .line 82
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setSupportZoom(Z)V

    .line 83
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setBuiltInZoomControls(Z)V

    .line 84
    invoke-virtual {v1, v4}, Landroid/webkit/WebSettings;->setJavaScriptCanOpenWindowsAutomatically(Z)V

    .line 85
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    new-instance v3, Lcom/teewoo/app/bus/ui/WebViewActivity$MyWebChromeClient;

    invoke-direct {v3, p0, v5}, Lcom/teewoo/app/bus/ui/WebViewActivity$MyWebChromeClient;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;Lcom/teewoo/app/bus/ui/WebViewActivity$MyWebChromeClient;)V

    invoke-virtual {v2, v3}, Landroid/webkit/WebView;->setWebChromeClient(Landroid/webkit/WebChromeClient;)V

    .line 86
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    new-instance v3, Lcom/teewoo/app/bus/ui/WebViewActivity$myWebViewClient;

    invoke-direct {v3, p0, v5}, Lcom/teewoo/app/bus/ui/WebViewActivity$myWebViewClient;-><init>(Lcom/teewoo/app/bus/ui/WebViewActivity;Lcom/teewoo/app/bus/ui/WebViewActivity$myWebViewClient;)V

    invoke-virtual {v2, v3}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 95
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    if-eqz v2, :cond_1

    .line 96
    iget-object v2, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    iget-object v3, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->currentUrl:Ljava/lang/String;

    invoke-virtual {v2, v3}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V

    .line 97
    :cond_1
    invoke-virtual {p0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->initImageButton()V

    .line 98
    return-void
.end method

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 1
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 244
    const/4 v0, 0x4

    if-ne p1, v0, :cond_2

    .line 245
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->progressDlg:Landroid/app/ProgressDialog;

    if-eqz v0, :cond_0

    .line 246
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->progressDlg:Landroid/app/ProgressDialog;

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V

    .line 248
    :cond_0
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->canGoBack()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 249
    iget-object v0, p0, Lcom/teewoo/app/bus/ui/WebViewActivity;->localWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->goBack()V

    .line 252
    :goto_0
    const/4 v0, 0x1

    .line 254
    :goto_1
    return v0

    .line 251
    :cond_1
    invoke-virtual {p0}, Lcom/teewoo/app/bus/ui/WebViewActivity;->finish()V

    goto :goto_0

    .line 254
    :cond_2
    invoke-super {p0, p1, p2}, Lcom/teewoo/app/bus/inface/BaseActivity;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    goto :goto_1
.end method
